﻿<UserControl x:Class="CncConvProg.View.Lavorazioni.Foratura.Pattern.XyDrillingPattern"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:CustomControl="clr-namespace:CncConvProg.View.Controls" xmlns:ab="clr-namespace:CncConvProg.View.AttachedProperty" xmlns:Resources="clr-namespace:MecPrev.Resources;assembly=MecPrev.Resources" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <StackPanel Orientation="Vertical">
            <StackPanel>
                <StackPanel Orientation="Horizontal" Style="{DynamicResource StackPanelStyle1Dialog}">
                    <TextBlock Text="{x:Static Resources:EditWorkRes.RefPointX}" Width="100" />
                    <TextBox ab:AttachedProperties.AutoSelectText="True" Text="{Binding Path=CenterX, ValidatesOnDataErrors=True}" Style="{DynamicResource TextBoxStyle1Dialog}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Style="{DynamicResource StackPanelStyle1Dialog}">
                    <TextBlock Text="{x:Static Resources:EditWorkRes.RefPointY}" Width="100" />
                    <TextBox  ab:AttachedProperties.AutoSelectText="True" Text="{Binding Path=CenterY, ValidatesOnDataErrors=True}" Style="{DynamicResource TextBoxStyle1Dialog}"/>
                </StackPanel>
                <Button DockPanel.Dock="Top" Command="{Binding AddPntCmd}" Margin="5" Width="150" HorizontalAlignment="Left">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="pack://application:,,,/CncConvProg.View;component/Images/Gui/addPlus.png"  Width="16"/>
                        <TextBlock Text="{x:Static Resources:EditWorkRes.btnAddPoint}" VerticalAlignment="Center" Margin="5" />
                    </StackPanel>
                </Button>
            </StackPanel>
            <ListView ItemsSource="{Binding Path=PointList}">
                <ListView.Resources>
                    <Style TargetType='{x:Type ListViewItem}'>
                        <Setter Property='HorizontalContentAlignment' Value='Stretch'/>
                    </Style>
                </ListView.Resources>
                <ListView.View>
                    <GridView>
                        <GridViewColumn Header="X" Width="125" >
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBox ab:AttachedProperties.AutoSelectText="True" Text="{Binding Path=CooX }"/>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Header="Y" Width="125" >
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBox ab:AttachedProperties.AutoSelectText="True" Text="{Binding Path=CooY }"/>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Width="125" >
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <Button
                                        Command="{Binding DataContext.DelPntCmd, RelativeSource={RelativeSource AncestorLevel=1, AncestorType={x:Type UserControl}, Mode=FindAncestor}}"
                                        CommandParameter="{Binding}" Content="Del"/>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                    </GridView>
                </ListView.View>
            </ListView>
        </StackPanel>
        
    </Grid>
</UserControl>
